<!DOCTYPE HTML>
<html>

<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title></title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="description" content="" />
	<meta name="keywords" content="" />
	<meta name="author" content="" />
	<!-- Facebook and Twitter integration -->
	<meta property="og:title" content="" />
	<meta property="og:image" content="" />
	<meta property="og:url" content="" />
	<meta property="og:site_name" content="" />
	<meta property="og:description" content="" />
	<meta name="twitter:title" content="" />
	<meta name="twitter:image" content="" />
	<meta name="twitter:url" content="" />
	<meta name="twitter:card" content="" />

	<link href="https://fonts.googleapis.com/css?family=Oxygen:300,400" rel="stylesheet">
	<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700" rel="stylesheet">

	<!-- icon小图标 -->
	<link rel="icon" href="../statics/images/icon_S_Bar_Contact.png" type="image/x-icon">
	<!-- Animate.css -->
	<link rel="stylesheet" href="../statics/css/animate.css">
	<!-- Icomoon Icon Fonts-->
	<link rel="stylesheet" href="../statics/css/icomoon.css">
	<!-- Bootstrap  -->
	<link rel="stylesheet" href="https://www.jq22.com/jquery/bootstrap-3.3.4.css">
	
	<!-- Magnific Popup -->
	<link rel="stylesheet" href="../statics/css/magnific-popup.css">
	<!-- Flexslider  -->
	<link rel="stylesheet" href="../statics/css/flexslider.css">
	<!-- Theme style  -->
	<link rel="stylesheet" href="../statics/css/style.css">
	<!-- Modernizr JS -->
	<script src="../statics/js/modernizr-2.6.2.min.js"></script>
	<!-- FOR IE9 below -->
	<!--[if lt IE 9]>
	<script src="js/respond.min.js"></script>
	<![endif]-->

	<style>
		.col-sm {
			margin-top: 10rem;
		}

		.form-control {
			width: 30%;
			height: 10%;
			margin-left: 30%;
			margin-bottom: -1rem;
		}
	</style>
	<style>
		* {
			padding: 0;
			margin: 0;
		}

		.wrap {
			width: 600px;
			margin: 50px auto;
		}

		.msgBox {
			margin-top: 10px;
		}

		.msgBox>.title,
		.msgBox .sub {
			display: flex;
			background-color: cadetblue;
		}

		.msgBox span {
			flex: 1;
			text-align: center;
			line-height: 30px;
			color: #fff;
			border: 1px solid #fff;
		}

		.shadow {
			position: fixed;
			top: 0;
			left: 0;
			width: 100%;
			height: 100%;
			background-color: rgba(0, 0, 0, 0.5);
			display: none;
		}

		.shadow .addMsg {
			color: black;
			padding: 50px;
			background-color: azure;
			position: absolute;
			left: 50%;
			top: 20%;
			transform: translate(-50%, -50%);
		}

		.shadow .addMsg p {
			margin: 10px 0;
		}
		
	</style>

</head>

<body>

	<div class="fh5co-loader"></div>

	<div id="page">
		<nav class="fh5co-nav" role="navigation">
			<div class="container-wrap">
				<div class="top-menu">
					<div class="row">
						<div class="col-xs-2">
							<div id="fh5co-logo"><img src="/statics/images/Gologo.png" alt="" width="180" height="40"></div>
						</div>
						<div class="col-xs-10 text-right menu-1" style="margin-left: -3rem;">
							<ul>
								<li class="active"><a href="/">首页</a></li>
								<li><a href="work.html">问卷案例</a></li>
								<!-- <li><a href="about.html">关于我们</a></li>
								<li><a href="contact.html">联系我们</a></li> -->
								<li class="has-dropdown">
									<a href="#"><img src="../statics/images/Google Play logo.png" width="20"
											height="20"></a>
									<ul class="dropdown">
										<li><a href="/about_bz" style="margin-left: 1.5rem;">帮助中心</a></li>
										<li><a href="/work-single" style="margin-left: 1.5rem;">账户中心</a></li>
										<!-- <li><a href="#">日常反馈</a></li> -->
										<li><a href="#" style="margin-left: 1.5rem;">退出登录</a></li>
									</ul>
								</li>
							</ul>
						</div>
					</div>

				</div>
			</div>
		</nav>
		<div class="container-wrap">
			<div id="fh5co-work">
				<div class="row">
					<div class="col-md-4 fh5co-project-detail">
						<h2 class="fh5co-project-title">账户信息</h2>
						<hr style="height:1rem;border:none;border-top:1px solid #0ebe49;" />
					</div>

					<div class="col-sm">
						<!-- <form>
						<div class="form-group">
						  <input type="username" class="form-control" id="exampleInputPassword1" placeholder="用户名">
						</div>
						<div class="form-group">
						  <input type="password" class="form-control" id="exampleInputPassword1" placeholder="序列号">
						</div>
						<div class="form-group">
						  <input type="password" class="form-control" id="exampleInputPassword1" placeholder="手机号">
						</div>
						<div class="form-group">
						  <input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="邮箱">
						</div>
						<div class="form-group">
						  <input type="password" class="form-control" id="exampleInputPassword1" placeholder="登录密码">
						</div>
					  </form> -->
					</div>
					<div class="clo-sm">
						<div class="wrap">
							<p>
								<button id="add">新增</button>
							</p>

							<div class="msgBox">
								<div class="title">
									<span>用户名</span>
									<span>密 码</span>
									<span>删除</span>
									<span>编辑</span>
								</div>
								<div class="content">
									<!-- <div class="sub">
									<span>111</span>
									<span>2222</span>
									<span>删除</span>
									<span>编辑</span>
								</div> -->
								</div>
							</div>
						</div>
						<!-- 弹出框 -->
						<div class="shadow">
							<div class="addMsg">
								<form>
									<div class="form-group row">
										<label for="user" class="col-sm-2 col-form-label">Username</label>
										<div class="col-sm-10">
											<input type="username" style="width: 20rem;" class="form-control" id="user">
										</div>
									</div>
									<div class="form-group row">
										<label for="age" class="col-sm-2 col-form-label">Password</label>
										<div class="col-sm-10">
											<input type="password" style="width: 20rem;" class="form-control" id="age">
										</div>
									</div>
									<input class="btn btn-primary" type="button" id="send" value="确定">
									<input class="btn btn-primary" type="button" id="cancel" value="取消">
								</form>
								<!-- <p>
									<label for="user">姓名</label>
									<input class="log_reg" id="user" type="text">
								</p>
								<p>
									<label for="age">年吃龄</label>
									<input class="log_reg" id="age" type="text">
								</p> -->
								<!-- <p>
									<input type="button" id="send" value="确定">
									<input type="button" style="margin-left: 2rem;" id="cancel" value="取消">
								</p> -->
							</div>
						</div>
					</div>

				</div>
			</div>
		</div><!-- END container-wrap -->

		<div class="container-wrap">
			<footer id="fh5co-footer" role="contentinfo">


				<div class="row copyright">
					<div class="col-md-12 text-center">
						<p> <small class="block">设置</small></p>
						<p>
						<ul class="fh5co-social-icons">
							<li><a href="#"><i class="icon-twitter"></i></a></li>
							<li><a href="#"><i class="icon-facebook"></i></a></li>
							<li><a href="#"><i class="icon-linkedin"></i></a></li>
							<li><a href="#"><i class="icon-dribbble"></i></a></li>
						</ul>
						</p>
					</div>
				</div>
			</footer>
		</div><!-- END container-wrap -->
	</div>

	<div class="gototop js-top">
		<a href="#" class="js-gotop"><i class="icon-arrow-up2"></i></a>
	</div>

	<!-- 背景特效 -->
	<script async type="text/javascript" size="90" alpha="0.2" zIndex="0"
		src="/statics/js/wall_paper/ribbon.js"></script>
	<!-- jQuery -->
	<!-- <script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script> -->
	<script src='https://s1.pstatp.com/cdn/expire-1-M/jquery/1.10.2/jquery.min.js'></script>
	<!-- jQuery Easing -->
	<script src="../statics/js/jquery.easing.1.3.js"></script>
	<!-- Bootstrap -->
	<script src="https://www.jq22.com/jquery/bootstrap-3.3.4.js"></script>
	<!-- Waypoints -->
	<script src="../statics/js/jquery.waypoints.min.js"></script>
	<!-- Flexslider -->
	<script src="../statics/js/jquery.flexslider-min.js"></script>
	<!-- Magnific Popup -->
	<script src="../statics/js/jquery.magnific-popup.min.js"></script>
	<script src="../statics/js/magnific-popup-options.js"></script>
	<!-- Counters -->
	<script src="../statics/js/jquery.countTo.js"></script>
	<!-- Main -->
	<script src="../statics/js/main.js"></script>


	<script>
		var addBtn = document.getElementById("add");
		var shadowB = document.getElementsByClassName("shadow")[0];
		var sendB = document.getElementById("send")
		var userB = document.getElementById("user");
		var ageB = document.getElementById("age");
		var contentD = document.getElementsByClassName("content")[0];
		var cancelB = document.getElementById("cancel");
		//    var deleteB=contentD.getElementsByTagName("span")
		var userlist = [];
		addBtn.onclick = function () {
			shadowB.style.display = "block";
			sendB.onclick = fn
		}

		sendB.onclick = fn
		function fn() {
			var userValue = userB.value;
			var ageValue = ageB.value;
			if (userlist.indexOf(userValue) == -1) {
				var sub = document.createElement("div");
				var userspan = document.createElement("span");
				userspan.innerHTML = userValue
				sub.appendChild(userspan)
				var agespan = document.createElement("span");
				agespan.innerHTML = ageValue
				sub.appendChild(agespan)
				var deletespan = document.createElement("span");
				deletespan.innerHTML = "删除"

				deletespan.onclick = function () {
					if (confirm("确定要删除我么?")) {
						userspan.parentElement.remove()
					}
				}
				sub.appendChild(deletespan)
				var editspan = document.createElement("span");
				editspan.innerHTML = "编辑"
				sub.appendChild(editspan)
				editspan.onclick = function () {
					userB.value = userspan.innerHTML
					ageB.value = agespan.innerHTML
					shadowB.style.display = "block";
					sendB.onclick = function () {
						var userValue = userB.value;
						var ageValue = ageB.value;
						userspan.innerHTML = userValue;
						agespan.innerHTML = ageValue;
						shadowB.style.display = "none";
						userB.value = ""
						ageB.value = ""
					}
				}
			}
			else {
				alert("用户名重复")
			}

			sub.className = "sub"
			// console.log(sub)
			contentD.appendChild(sub)
			userlist.push(userspan.innerHTML)
			shadowB.style.display = "none";
			userB.value = "";
			ageB.value = "";
		}
		cancelB.onclick = function () {
			shadowB.style.display = "none";
			userB.value = ""
			ageB.value = ""
		}
	</script>

</body>

</html>